<template>
	<u-modal :show="showBox"  :title="boxTitle" :closeOnClickOverlay="true" :showCancelButton="true"   @confirm="confirmBox"   @cancel="()=>{this.showBox=false}">
		<view class="slot-content">
			<view class="form_box" >
				
				<uni-forms ref="form" :rules="rules" >
				
						
					<uni-forms-item v-if="dataList.length>0" label="付款方式" name="pay_type">
						<view class="form_item_input">
							<picker @change="selectChange" data-key="code_name" :value="payIndex" :range="dataList" :range-key="'code_name'">
								<view style="padding-left: 20rpx;line-height: 60rpx;" class="uni-input">{{dataList[payIndex].code_name}}</view>
							</picker>
						</view>
					</uni-forms-item>
					
					<uni-forms-item v-if="codeList.length>0" label="付款类型" name="pay_type">
						<view class="form_item_input">
							<picker @change="selectChange" data-key="code_type" :value="codeIndex" :range="codeList" :range-key="'name'">
								<view style="padding-left: 20rpx;line-height: 60rpx;" class="uni-input">{{codeList[codeIndex].name}}</view>
							</picker>
						</view>
					</uni-forms-item>
					
					<uni-forms-item v-if="codeImg" label="付款码">
						<view  class="code_img">
							<image  mode="aspectFill" :src="codeImg"></image>
						</view>
					</uni-forms-item>
				</uni-forms>
				<u-modal content="是否扫码支付完毕？" :show="showConfirm" showCancelButton closeOnClickOverlay @confirm="confirmCode" @cancel="()=>{this.showConfirm=false}"  ></u-modal>
			</view>
		</view>
	</u-modal>
</template>

<script>
	import {index} from './pay-code.js';
	export default {name: 'payCode',mixins: [index]}
</script>
<style>
	@import 'pay-code.css';
</style>
